home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: assembler in borland C 4.5
- Date: 2 Jan 1996 22:41:40 GMT
- Organization: Pipeline USA
- Message-ID: <4cccb4$6kg@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe6.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Jan 02, 1996 14:08:40 in article <assembler in borland C 4.5>, 'Per
- Wiberg <e95_pwi@elixir.e.kth.se>' wrote:
-
-
- >Well.. I got a CD with a lot of programs from my school (KTH in
- >stockholm) and among them BC4.5. AND no manual, reference-book or
- >anything!.
- >"lucky-me" I've got no CD-ROM drive! ... so I made my friend raw-copy
- >BC4.5 on to floppy's (bad idea!). And here I am with a silly question:
- >
- Hmm, I don'w see what the above has to do with the question.
-
- >- how do you include assembler code in BC4.5 ?
-
- If you mean inline assembly (which is only a subset of ASM), it goes
- something like this:
-
- int Foo (int n)
- {
- asm {
- mov ax,n
- add ax,5
- }
- }
-
- Some not-so-apparent rules are:
- the enclosed braces (at least the first one) must be on a line
- that doesn't contain any ASM directives.
- There's restrictions on comments. I don't remember the rules
- but to be safe, don't use any.
- If you make errors, the compiler sometimes reports errors in
- a completely different place from the actual error and the message
- is gobbdleygook -- moral: Don't make any errors in your asm code. :-)
-
- --
-
- Pete
-